package org.example.web;

import org.example.model.*;
import org.example.service.GuideService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController //功能是将类声明为一个控制器，并使其中的方法可以直接响应HTTP请求
@RequestMapping("/userApi/guideCtl")
public class GuideController {
    @Autowired
    private GuideService guideService;

    @RequestMapping("/getGuide")
    public Result getGuide() {
        List<Hotel> guideList = guideService.getHotelList();
        return new Result(200, "获取成功", guideList);
    }
    @RequestMapping("/getEmergnecy")
    public Result getEmergnecy() {
        List<Emergency> emergencyList = guideService.getEmergencyList();
        return new Result(200, "获取成功", emergencyList);
    }
    @RequestMapping("/getTips")
    public Result getTips() {
        List<Tips> tipsList = guideService.getTipsList();
        return new Result(200, "获取成功", tipsList);
    }
    @RequestMapping("/externalTraffic")
    public Result externalTraffic() {
        List<Traffic> externalTraffic = guideService.externalTraffic();
        return new Result(200, "获取成功", externalTraffic);
    }
    @RequestMapping("/internalTraffic")
    public Result internalTraffic() {
        List<Traffic> internalTraffic = guideService.internalTraffic();
        return new Result(200, "获取成功", internalTraffic);
    }

}
